const router = require('@koa/router')({prefix: '/users'})
const { register, login, info, upload } = require('./controller')
const { verifyLogin, bcrpytPassword, userValidator, verifyUser, isManger } = require('@/middleware/user')
// const { validator } = require('@/middleware/goods')

router.post('/register', userValidator, verifyUser, bcrpytPassword, register)
router.post('/login', verifyLogin, login)
router.get('/info', info)
// router.get('/info', validator, info)
router.post('/upload', isManger, upload)

module.exports = router.routes()